﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;


namespace Topro.Admin.Controllers
{
    using Topro.Application.Interface;
    using Topro.Entity.Query;

    /// <summary>
    /// 报表控制器
    /// </summary>
    public class ReportController : BaseController
    {
        #region 注入
        /// <summary>
        /// 库存接口
        /// </summary>
        private readonly InventoryService _inventoryService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="stockInService">库存接口</param>
        public ReportController(InventoryService inventoryService)
        {
            _inventoryService = inventoryService;
        }
        #endregion

        /// <summary>
        /// 出入库报表
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>DataGrid<StockInQueryResponse></returns>
        public JsonResult InventoryQuery(InventoryQuery query)
        {
            var list = _inventoryService.ReportInventoryQuery(query);

            return Json(list);
        }
    }
}
